package com.buchong.controller;

import com.buchong.pojo.Book;
import com.buchong.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/book")
public class BookController {
    @Autowired
    private BookService bookService;
    @RequestMapping("/show")
    public String show1(Model model, @RequestParam("id")Integer id){
        Book one = bookService.findOne(id);
        model.addAttribute("book",one);
        return "图书介绍";
    }

}
